# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=rdma-core
pkgver=51.0
pkgrel=0
pkgdesc="RDMA core userspace libraries and daemons"
url="https://github.com/linux-rdma/rdma-core"
license="GPL-2.0-only OR BSD-2-Clause"
arch="all !s390x" # s390x ftbfs
options="!check" # tests are for installation
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
	cmake
	eudev-dev
	libdrm-dev
	libnl3-dev
	py3-docutils
	samurai
	"
subpackages="$pkgname-libs $pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://github.com/linux-rdma/rdma-core/releases/download/v$pkgver/rdma-core-$pkgver.tar.gz
	Cmakelists.patch"

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
25b92f4cf98172c00bdfc166666307be39fbdbc061e91c290fee9e932829df799e864019273cfd1f6118968bdfb3361b467d414f062b5bd7a269246c5857671d  rdma-core-51.0.tar.gz
0cc864e07087287ffa4b90d5ce6efdc4ab6f0ca54b01c77eb5ed28568c89f978429fd3687b5bafed726663d9145e1123e1701e9e58a59cbf9715f96d8f2b1bbe  Cmakelists.patch
"
